<%@ page isELIgnored="false"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Course - Owner View</title>
</head>
<body>
	<div style="width:800px; margin:auto; margin-top: 40px; font-size: 1.1em;">
		<h2> ${course.courseName} - (Professor ${user.lastName}) </h2>
		
		<div style="margin-top:15px;">
			<b>Notes:</b>
			<c:choose>
				<c:when test="${numOfNotes > '0'}">
					<table style="width: 780px; text-align: center;">
						<c:forEach items="${notesInfos}" var="notesInfo">
							<tr>
								<td style="border: solid 1px #bbbbbb;">
									<a href="/professor/course/${course.id}/notes/${notesInfo.blobKey.keyString}/${notesInfo.filename}"> ${ notesInfo.filename } </a>
								</td>
								<td style="border: solid 1px #bbbbbb;">
									${ notesInfo.creation }
								</td>
								<td style="border: solid 1px #bbbbbb;">
									${ notesInfo.size } Bytes
								</td>
							</tr>
						</c:forEach>
					</table>
				</c:when>
				
				<c:otherwise>
					<p> This class currently has no notes. Please add some notes.</p>
				</c:otherwise>
			</c:choose>
			<br />
			<form action="${notesUploadUrl}" method="post" enctype="multipart/form-data">
				<input type="file" name="notesFile"> 
				<input type="submit" value="Upload File">
			</form>
		</div>
		
	</div>
</body>
</html>